//
// Created by Administrator on 2025/9/19.
//

#include "OperatorOverloading.h"

void Complex::Print(){
std::cout<< "(" << x << ","<<y<<")"<< std::endl;
}
Complex operator+(const Complex &c1, const Complex &c2){
    std::cout << "Friend" << std::endl;
    return {c1.x + c2.x, c1.y + c2.y};
}

Complex Complex::operator+(const Complex &other){
    std::cout << "Number" << std::endl;
    return {x + other.x, y + other.y};
}
Complex & Complex::operator-(){
    this->x = -x;
    this->y = -y;
    return *this;
}

Complex & Complex::operator++() {
    this->x++;
    this->y++;
    return *this;
}

Complex & Complex::operator++(int) {
    return ++*this;
}

void Complex::Print(int) {
    std::cout<< "(" << x << ","<<y<<")"<< std::endl;
}

std::istream & operator >> (std::istream & is, Complex & c){
    is >> c.x >> c.y;
    return is;
}

std::ostream & operator << (std::ostream & os, Complex & c){
    os << "(" << c.x << "," <<c.y << ")";
    return os;
}

Sender & Sender::operator<<(const Mail &mail) {
    std::cout << "Address : " << addr << std::endl;
    std::cout << "Title : " << mail.title << std::endl;
    std::cout << "Content : " << mail.content << std::endl;
    return *this;
}
